package com.etc.medical.feign;

import com.etc.common.entity.BasicDoctor;
import com.etc.common.utils.Result;
import com.etc.medical.client.BasicDoctorClient;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * @author 29322
 */
@RestController
@RequestMapping("/doc")
@CrossOrigin(origins = "*")
public class BasicDoctorFeign {
    @Resource
    private BasicDoctorClient basicDoctorClient; // 加载 openfeign client

    /**
     * 查询医生工作统计
     *
     * @param docId
     * @return
     */
    @RequestMapping("/queryData")
    public Result queryData(@RequestParam String docId) {
        return basicDoctorClient.queryData(docId);
    }

    /**
     * 查询医生列表
     *
     * @return
     */
    @RequestMapping("/queryAll")
    public Result queryAll(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
        return basicDoctorClient.queryAll(pageNum, pageSize);
    }


    /**
     * 修改医生信息
     * p
     *
     * @param doctor
     * @return
     */
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public Result update(BasicDoctor doctor) {
        return basicDoctorClient.update(doctor);
    }

    /**
     * 注销医生
     */
    @RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
    public Result updateStatus(@RequestParam String docId) {
        return basicDoctorClient.updateStatus(docId);
    }
}
